package com.tuling.designpattern.chain;

/**
 * @author it-小林
 * @desc   客户端
 * @date 2021年10月13日 20:20
 */
public class Client {
    public static void main(String[] args) {
        //组建职责链
        Handler handler1 = new ConcreteHandler1();
        Handler handler2 = new ConcreteHandler2();
        Handler handler3 = new ConcreteHandler3();
        handler1.setNext(handler2);
        handler2.setNext(handler3);
        //提交请求
        System.out.println("=================提交one================");
        handler1.handleRequest("one");
        System.out.println("=================提交two================");
        handler1.handleRequest("two");
        System.out.println("=================提交three================");
        handler1.handleRequest("three");
        System.out.println("=================提交four================");
        handler1.handleRequest("four");
    }
}
